<?php
/**
 * ShopEx licence
 *
 * @copyright  Copyright (c) 2005-2012 ShopEx Technologies Inc. (http://www.shopex.cn)
 * @license  http://ecos.shopex.cn/ ShopEx License
 */

class b2c_tasks_updatemembers extends base_task_abstract implements base_interface_task{
    public function exec($params=null){
//        	logger::info('result:');
        	$model=app::get('b2c')->model('members');
	        $res=$model->getList('member_id,ex_money,pre_ex_money,offline_money,pre_offline_money');
	       
	        foreach($res as $k=>$value){

	        	$data[$k]=array(
					'pre_ex_money'=>$value['ex_money'],'ex_money'=>0,
					'pre_offline_money'=>$value['offline_money'],'offline_money'=>0);
	        	$res=$model->update($data[$k],array('member_id'=>$value['member_id']));
	        	
	        }
    }
}